<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: lyh
  Date: 2025/3/8
  Time: 12:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
这时我的首页
<%
    Date date=new Date();
    int a=10;
%>

a里的值是：<%=a%>
当前时间是：<%=sb(date)%>

<%!
    int b=10;
%>
<%b++;%>
<hr>
b里的值是：<%=b%>
<%!
    String sb(Date date){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy张MM东dd升");//更改格式
        return sdf.format(date);
    }
%>

</body>
</html>
